#ifndef COUNTDOWN_H
#define COUNTDOWN_H

#include <QWidget>
#include <QTimer>

class CountDown : public QWidget
{
    Q_OBJECT
public:
    explicit CountDown(QWidget *parent = nullptr);

    void showCountDown();

    //若已打出牌，则提前终止倒计时
    void stopCountDown();

signals:
    //出牌时间只剩5秒时，发出该信号
    void notMuchTime();

    //出牌时间结束
    void timeout();

protected:
    void paintEvent(QPaintEvent *ev);

private:
    QPixmap m_clock;
    QPixmap m_number;
    QTimer* m_timer;
    int m_count;
};

#endif // COUNTDOWN_H
